surface: Give backends a chance to disconnect
authorMatthias Clasen <mclasen@redhat.com>
Fri, 24 May 2019 01:56:35 +0000 (01:56 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 May 2019 20:25:17 +0000 (20:25 +0000)
Call the destroy vfunc before clearing
frame clock and gl context, so backends
have a chance to clean up.

gdk/gdksurface.c

index 16c3ed5e60dea9cba73a17c1bacde8febfe41bad..28f8f584e9000f4753cd7079f95f7c39674c7672 100644 (file)
@@ -919,6 +919,8 @@ _gdk_surface_destroy_hierarchy (GdkSurface *surface,
 
   display = gdk_surface_get_display (surface);
 
+  GDK_SURFACE_GET_CLASS (surface)->destroy (surface, foreign_destroy);
+
   if (surface->gl_paint_context)
     {
       /* Make sure to destroy if current */
@@ -936,8 +938,6 @@ _gdk_surface_destroy_hierarchy (GdkSurface *surface,
 
   _gdk_surface_clear_update_area (surface);
 
-  GDK_SURFACE_GET_CLASS (surface)->destroy (surface, foreign_destroy);
-
   surface->state |= GDK_SURFACE_STATE_WITHDRAWN;
   surface->destroyed = TRUE;